package com.cmcc.groupcontacts.util;

import android.content.Context;

import com.cmcc.groupcontacts.common.Const;
import com.yinhai.activity.R;

/**
 * 程序信息管理器
 * 
 * @author 
 * 
 */
public abstract class AppManager {
	private static final String LOG_TAG = "ApplicationManager";

	public static int getVerCode(Context context) {
		int verCode = 1;
		try {
			verCode = context.getPackageManager().getPackageInfo(Const.PACKAGE_NAME, 0).versionCode;
		} catch (Exception e) {
			ExceptionHandler.handle(e);
		}
		return verCode;
	}

	public static String getVerName(Context context) {
		String verName = "";
		try {
			verName = context.getPackageManager().getPackageInfo(Const.PACKAGE_NAME, 0).versionName;
		} catch (Exception e) {
			ExceptionHandler.handle(e);
		}
		return verName;
	}

	public static String getAppName(Context context) {
		String verName = context.getResources().getText(R.string.app_name).toString();
		return verName;
	}
}
